import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '社区名称',
    align: "center",
    dataIndex: 'communityName'
  },
  {
    title: '结余月份',
    align: "center",
    dataIndex: 'balanceMonth',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '卫生费',
    align: "center",
    dataIndex: 'sanitationFee'
  },
  {
    title: '物业费',
    align: "center",
    dataIndex: 'propertyFees'
  },
  {
    title: '管道加压费',
    align: "center",
    dataIndex: 'pipelinepressurizationfee'
  },
  {
    title: '车位服务费',
    align: "center",
    dataIndex: 'parkingservices'
  },
  {
    title: '水费',
    align: "center",
    dataIndex: 'water'
  },
  {
    title: '装修保证金',
    align: "center",
    dataIndex: 'depositcollection'
  },
  {
    title: '预存物业费',
    align: "center",
    dataIndex: 'prepaidPropertyFees'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "社区名称",
    field: 'communityName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "结余月份",
    field: 'balanceMonth',
    component: 'DatePicker',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '社区名称',
    field: 'communityName',
    component: 'Input',
  },
  {
    label: '结余月份',
    field: 'balanceMonth',
    component: 'DatePicker',
  },
  {
    label: '卫生费',
    field: 'sanitationFee',
    component: 'InputNumber',
  },
  {
    label: '物业费',
    field: 'propertyFees',
    component: 'InputNumber',
  },
  {
    label: '管道加压费',
    field: 'pipelinepressurizationfee',
    component: 'InputNumber',
  },
  {
    label: '车位服务费',
    field: 'parkingservices',
    component: 'InputNumber',
  },
  {
    label: '水费',
    field: 'water',
    component: 'InputNumber',
  },
  {
    label: '装修保证金',
    field: 'depositcollection',
    component: 'InputNumber',
  },
  {
    label: '预存物业费',
    field: 'prepaidPropertyFees',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  communityName: {title: '社区名称',order: 0,view: 'text', type: 'string',},
  balanceMonth: {title: '结余月份',order: 1,view: 'date', type: 'string',},
  sanitationFee: {title: '卫生费',order: 2,view: 'number', type: 'number',},
  propertyFees: {title: '物业费',order: 3,view: 'number', type: 'number',},
  pipelinepressurizationfee: {title: '管道加压费',order: 4,view: 'number', type: 'number',},
  parkingservices: {title: '车位服务费',order: 5,view: 'number', type: 'number',},
  water: {title: '水费',order: 6,view: 'number', type: 'number',},
  depositcollection: {title: '装修保证金',order: 7,view: 'number', type: 'number',},
  prepaidPropertyFees: {title: '预存物业费',order: 8,view: 'number', type: 'number',},
};
